<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>菜品管理</title>
    <link href="/webjars/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <script src="webjars/jquery/3.0.0/jquery.min.js"></script>
    <script src="webjars/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>

<ul class="nav nav-tabs">
    <li class="nav-item">
        <a class="nav-link" href="/userinfo.html">个人首页</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="/rankinglist.html">排行榜</a>
    </li>
    <li class="nav-item">
        <a class="nav-link active" href="/admin/menusmanage.html">菜品管理</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="/background.html">订单管理</a>
    </li>
</ul>


<div class="container p-5">

    <div class="card">
        <div class="card-header">
            <h1 class="card-title">
                菜单管理页面
            </h1>
        </div>

        <div class="card-body">
            <form class="form-horizontal" method="post" action="/admin/newmenu.do">
                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="form_input_foodname">菜品名</label>
                            <input type="text" id="form_input_foodname" name="mName" class="form-control">
                        </div>

                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="form_input_price">菜品价格</label>
                            <input type="text" id="form_input_price" name="mPrice" class="form-control">
                        </div>

                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="form_input_discribe">菜品描述</label>
                            <input type="text" id="form_input_discribe" name="mDiscribe" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="form_input_photo">菜品图片</label>
                            <input type="file" id="form_input_photo" name="mPhoto" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-4 offset-2">
                        <button type="submit" class="btn-block">创建菜品</button>
                    </div>

                    <div class="col-md-4 border-left-2">
                        <button type="reset" class="btn-block">重置</button>
                    </div>

                </div>
            </form>

            <br>

            <table class="table  table-hover">
                <thead class="table-dark">
                <tr>
                    <div class="col-md-2">
                        <td>菜名</td>
                    </div>
                    <div class="col-md-2">
                        <td>价格</td>
                    </div>
                    <div class="col-md-2">
                        <td>删除操作</td>
                    </div>
                    <div class="col-md-2">
                        <td>修改操作</td>
                    </div>
                    <div class="col-md-2">
                        <td>更多操作</td>
                    </div>
                </tr>
                </thead>
                <tr th:each="food : ${menuList}">

                    <td th:text="${food.mName}"></td>
                    <td th:text="${food.mPrice}"></td>
                    <td><a th:href="@{'/admin/deletemenu.do?mid='+${food.mId}}">删除菜品</a></td>

                    <td>
                        <form action="/admin/updatemenu.do" id="form_update" method="get">
                            <input type="hidden" name="mid" th:value="${food.mId}">
                            <input type="text" name="updateprice" class="form-control">
                            <button type="submit">修改价格</button>
                        </form>
                    </td>

                    <td>
                        <a href="#">更多操作</a>
                    </td>
                </tr>
            </table>

        </div>

        <div class="card-footer">
            点餐系统菜单105
            <div class="btn-group offset-6">
                <button class="btn-block">
                    <a class="" th:href="@{'/admin/menusmanage.last?page='+${current -1}+'&size=5'}"> << </a>
                </button>

                <button class="number-button">
                    <span class="number-button" th:text="${current +1}"></span>
                </button>

                <button class="number-button">
                    <a class="" th:href="@{'/admin/menusmanage.next?page='+${current +1}+'&size=5'}" th:text="${current +2}"></a>
                </button>

                <button class="btn-block">
                    <a class="" th:href="@{'/admin/menusmanage.next?page='+${current +1}+'&size=5'}"> >> </a>
                </button>

            </div>
        </div>
    </div>

</div>

</body>
</html>